<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
        xmlns:icecore="http://www.icefaces.org/icefaces/core"
       xmlns:ace="http://www.icefaces.org/icefaces/components"
       xmlns:ice="http://www.icesoft.com/icefaces/component"
       >
    <h:head>
        <title>ICEfaces 2</title>
        <link rel="stylesheet" type="text/css" href="./xmlhttp/css/rime/rime.css"/>
    </h:head>
    <h:body>
        <div id="header">
           <!--
           <ui:include src="/header.xhtml" >
	          <ui:param name="param_name" value="param_value" />
           </ui:include>
           -->
        </div>
         <div id="content">
             <h:form id="form">
                 <ice:outputText>Bitte geben sie folgende Informationen an</ice:outputText><br />
                 <ice:outputText>Vorname</ice:outputText> <br />
                 <ice:inputText value="#{regBean.firstName}"
                                required="true"
                                requiredMessage="Bitte Vornamen eingeben"> </ice:inputText> <br />

                 <ice:outputText>Nachname</ice:outputText> <br />
                 <ice:inputText value="#{regBean.lastName}"
                                required="true"
                                requiredMessage="Bitte Nachnamen eingeben"/>  <br />

                 <ice:outputText>Username</ice:outputText> <br />
                 <ice:outputLabel value="#{regBean.username}" /> <br />
                 <ice:outputText>Matrikelnummer</ice:outputText> <br />
                 <ice:inputText value="#{regBean.studentID}"
                                required="true"
                                requiredMessage="Bitte Matrikelnummer eingeben (Falls keine vorhanden, bitte 0000000 eingeben)" /> <br />

                 <ice:outputText rendered="#{regBean.mailVergeben}"
                                 value ="Mailadresse ist bereits vergeben" />
                 <ice:outputText rendered="#{regBean.wrongMail}"
                                 value="Bitte verwenden sie ihre Universitäts E-Mail Adresse" />
                 <ice:outputText>E-Mail Adresse </ice:outputText> <br />
                 <ice:inputText value="#{regBean.mail}"
                                valueChangeListener="#{regBean.makeUsernameByMail}"
                                partialSubmit="true"
                                required="true"
                                requiredMessage="Bitte E-Mail Adresse eingeben">
                                <!-- TODO: Validator -->
                 </ice:inputText>
                 <br />
                 <ice:outputText>Studiengang</ice:outputText> <br />
                 <ice:selectOneMenu value="#{regBean.studiengang}"
                                    required="true"
                                    requiredMessage="Bitte Studiengang eingeben">
                     <f:selectItem noSelectionOption="true"
                                   itemLabel="-nichts ausgewählt-" />
                     <f:selectItems value="#{regBean.courses}" />
                 </ice:selectOneMenu>
                 <br />
                 <ice:outputText>Angestrebter Abschluss</ice:outputText><br />
                 <ice:selectOneMenu value="#{regBean.aspiredDegree}"
                                    required="true"
                                    requiredMessage="Bitte Angestrebten Abschluss auswählen">
                     <f:selectItems value="#{regBean.generateDegrees()}" />
                 </ice:selectOneMenu> 
                 <br />

                <ice:commandButton value="submit" action="#{regBean.doRegistration}"/>
                <br />
                <br />
                <ice:commandButton type="reset" 
                                   value="zurück"
                                   action="index.jsf" />
                <ice:messages></ice:messages>
             </h:form>
         </div>
    </h:body>
</html>